package com.zztl.infiniteBand.presenter

import android.content.Context

import com.zztl.infiniteBand.base.BasePresenter
import com.zztl.infiniteBand.model.FindBean
import com.zztl.infiniteBand.net.FilterSubscriber
import com.zztl.infiniteBand.net.RetorfitServiceManger
import com.zztl.infiniteBand.ui.view.mvpview.FindView

/**
 * @desc
 * @auth ${user}
 * @time 2018/9/25  10:15
 */
class FindPresenter : BasePresenter<FindView>() {
    fun getFindData(context: Context) {
        addSubscribe(RetorfitServiceManger
                .observe(RetorfitServiceManger.instance!!.apiService.getFindData(""))
                .subscribe(object : FilterSubscriber<FindBean>(context) {
                    override fun success(bean: FindBean) {
                        view!!.getSuccess(bean)
                    }

                    override fun fail() {
                        view!!.getFail()

                    }
                }))
    }
}
